package com.xx.springboot.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * decr:
 * create by Xiaoxi
 * email:xiaoxiunique@qq.com
 * phone:13541863172
 * date:2018/2/11 13:41
 * project_name:atomblog
 * package_name:com.xx.atomblog.framework.utils
 */
public class FileUtils {


    /**
     * @Author：Xiaoxi
     * @date：2018/2/11 13:42
     * @Version 1.0
     * @UpdateUser: 更新者
     * @UpdateDate 2018/2/11 13:42
     * @Method getRandomFileName
     * @Params []
     * @Return java.lang.String
     * @Description：获取的到随机名字
     */
    public static String getRandomFileName() {

        SimpleDateFormat simpleDateFormat;

        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");

        Date date = new Date();

        String str = simpleDateFormat.format(date);

        Random random = new Random();

        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数

        return rannum + str;// 当前时间
    }

}
